<?php /* Smarty version 2.6.13, created on 2013-10-08 10:02:29
         compiled from Admin/adminm.html */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../Public/Css/userp.css" />
<script type="text/javascript" src='../Public/Js/jquery.js'></script>
<script type="text/javascript">
	function showDiv(id){
		var h = document.body.clientHeight;
		$("#zhezhao").show();
		$("#adminupdate").show();
		$("#zhezhao").css("height",h+"px");
		
		$.ajax({
			type:'GET',
			url:'PowerAction.php',
			data:'flag=ajax&id='+id,
			dataType:'json',
			success:function(res){
					$("[name='insert']").attr("checked",false);
					$("[name='del']").attr("checked",false);
					$("[name='update']").attr("checked",false);
					$("[name='admin_id']").attr("value",res.admin_id);
					//alert(res.insert);
					if(res.insert == "1"){
						///alert('insert');
						$("[name='insert']").attr("checked",true);
					}
					//alert(res.del);
					if(res.del == "1"){
						//alert('del');
						$("[name='del']").attr("checked",true);
					}
					//alert(res.update);
					if(res.update == "1"){
					//	alert('update');
						$("[name='update']").attr("checked",true);
					}
				}
				
		});
	}
	function hideDiv(){
		$("#zhezhao").hide();
		$("#adminupdate").hide();
	}
	function changeSrc(){
		$("#closeImg").attr("src","../Public/Images/buttonhover.jpg");
	}
	function Too(){
		$("#closeImg").attr("src","../Public/Images/closebutton.jpg");
	}
</script>
</head>
<body>
<div class="content">

	<div class="pos">
		<div class="posDe">当前位置 : <font style="color:blue;">个人管理&gt;管理员管理</font></div>
	</div>
	<div id="adminm">
		<table>
			<tr><th>用户编号</th><th>用户名称</th><th colspan="3">用户权限</th><th>操作</th></tr>
			<?php $_from = $this->_tpl_vars['adminArr']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['v']):
?>
			<tr><td><?php echo $this->_tpl_vars['v']['admin_id']; ?>
</td><td><?php echo $this->_tpl_vars['v']['admin_name']; ?>
</td><td><?php if ($this->_tpl_vars['v']['admin_power']['0'] == 1): ?>[增]<?php endif; ?></td><td><?php if ($this->_tpl_vars['v']['admin_power']['1'] == 1): ?>[删]<?php endif; ?></td><td><?php if ($this->_tpl_vars['v']['admin_power']['2'] == 1): ?>[改]<?php endif; ?></td><td><a href="AdminDel.php?id=<?php echo $this->_tpl_vars['v']['admin_id']; ?>
">[删除]</a> <a id="asdf" href="javascript:showDiv(<?php echo $this->_tpl_vars['v']['admin_id']; ?>
);" >[修改]</a></td></tr>
			<?php endforeach; endif; unset($_from); ?>
		</table>
	
	</div>
</div>
<div id="zhezhao">
</div>
<div id='adminupdate'>
	<div style="float:right;"><img id="closeImg" src="../Public/Images/closebutton.jpg" onmouseover="changeSrc();" onmouseout="Too();" onclick="hideDiv();"/></div>
	<fieldset style="padding:50px;">
	<legend>管理员权限修改</legend>
		<form action="PowerAction.php?flag=updatePower" method="post">
			<table >
			<tr>
				<td><input type="hidden" name="admin_id"></td>
				<td>权&nbsp;&nbsp;&nbsp;&nbsp;限：</td>
				<td>
					&nbsp;&nbsp;<input type="checkbox" name="insert" value="1"> 增加&nbsp;
					<input type="checkbox" name="del" value="1"> 删除&nbsp;
					<input type="checkbox" name="update" value="1"> 更新
				</td>
				<td ><input type="image" src="../Public/Images/confirmSubmit.png"></td></tr>
			</table>
		</form>
	</fieldset>
	

</div>
</body>
</html>